<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>DC</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body class="text">
<p class="heading">Assembler Directives - DC<hr noshade></p>
<p></p>
<p><b>DC</b> - The DC directive instructs the assembler to place the following values into memory at the current location. The directive has three forms DC.B for byte data, DC.W for word (16-bit) data, and DC.L for long (32-bit) data. 
The Define Constant directive should not be confused with declaring a constant 
in C++.</p>
<p class="sourcecode">Usage:<br>
[label] DC.<i>size</i> data,data,...</p>
<p>For example:</p>
<p class="sourcecode">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ORG&nbsp;&nbsp;&nbsp; $1000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start of the data region <br>
  depart&nbsp;DC.B&nbsp;&nbsp; 'depart.wav',0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stores as a NULL terminated string in consecutive bytes <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DC.L&nbsp;&nbsp; $01234567&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the value $01234567 is stored as a long word<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DC.W&nbsp;&nbsp; 1,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; two words are stored as $0001 and $0002<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DC.L&nbsp;&nbsp; 1,2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two long words are stored as $00000001 and $00000002
<p>The 68000 microprocessor requires that word and long word numbers be stored in even memory addresses. The assembler will adjust the memory locations accordingly. Beginning with the 68020 and later versions of the 68000 this word boundary restriction was removed.</p>
<p>The result of the above code would be:</p>
<p class="sourcecode">00001000&nbsp; 64 65 70 61 72 74 2E 77 61 76 00 <br>
  0000100C&nbsp; 01234567 <br>
  00001010&nbsp; 0001 0002 <br>
  00001014&nbsp; 00000001 00000002</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
